\hypertarget{classduye_1_1_shm}{\section{duye\-:\-:Shm Class Reference}
\label{classduye_1_1_shm}\index{duye\-::\-Shm@{duye\-::\-Shm}}
}


shared memory for ipc  




{\ttfamily \#include $<$duye\-\_\-shm.\-h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{classduye_1_1_shm_a2a476f58df26f5740d791002906eeb37}{init} (const int8 $\ast$shm\-Path, const uint64 shm\-Size)
\begin{DoxyCompactList}\small\item\em constructor \end{DoxyCompactList}\item 
const int8 $\ast$ \hyperlink{classduye_1_1_shm_ac20c16b55c21861bbde59e0961ccb96d}{path} () const 
\begin{DoxyCompactList}\small\item\em get shm path \end{DoxyCompactList}\item 
uint64 \hyperlink{classduye_1_1_shm_a4b3279f66ae42910d650eef3cb25f4a9}{size} () const 
\begin{DoxyCompactList}\small\item\em get shm size \end{DoxyCompactList}\item 
bool \hyperlink{classduye_1_1_shm_a15f7a79aa99263339f9d94846fd36ddf}{sync} ()
\begin{DoxyCompactList}\small\item\em sync the shm \end{DoxyCompactList}\item 
bool \hyperlink{classduye_1_1_shm_a7094da8b2ea2a6116375945f2c43c256}{write} (const uint32 offset, const int8 $\ast$data, const uint32 length)
\begin{DoxyCompactList}\small\item\em write data to shm \end{DoxyCompactList}\item 
bool \hyperlink{classduye_1_1_shm_a7c14682004721b9f76964fd88204e3a4}{read} (const uint32 offset, int8 $\ast$buffer, const uint32 \hyperlink{classduye_1_1_shm_a4b3279f66ae42910d650eef3cb25f4a9}{size})
\begin{DoxyCompactList}\small\item\em read data from shm \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
shared memory for ipc 

\subsection{Member Function Documentation}
\hypertarget{classduye_1_1_shm_a2a476f58df26f5740d791002906eeb37}{\index{duye\-::\-Shm@{duye\-::\-Shm}!init@{init}}
\index{init@{init}!duye::Shm@{duye\-::\-Shm}}
\subsubsection[{init}]{\setlength{\rightskip}{0pt plus 5cm}bool duye\-::\-Shm\-::init (
\begin{DoxyParamCaption}
\item[{const int8 $\ast$}]{shm\-Path, }
\item[{const uint64}]{shm\-Size}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_shm_a2a476f58df26f5740d791002906eeb37}


constructor 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em shm\-Path} & \-: shm mapping file path \\
\hline
\mbox{\tt in}  & {\em shm\-Size} & \-: shm size \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\end{DoxyNote}
\hypertarget{classduye_1_1_shm_ac20c16b55c21861bbde59e0961ccb96d}{\index{duye\-::\-Shm@{duye\-::\-Shm}!path@{path}}
\index{path@{path}!duye::Shm@{duye\-::\-Shm}}
\subsubsection[{path}]{\setlength{\rightskip}{0pt plus 5cm}const int8$\ast$ duye\-::\-Shm\-::path (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classduye_1_1_shm_ac20c16b55c21861bbde59e0961ccb96d}


get shm path 

\begin{DoxyReturn}{Returns}
shm path 
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\end{DoxyNote}
\hypertarget{classduye_1_1_shm_a7c14682004721b9f76964fd88204e3a4}{\index{duye\-::\-Shm@{duye\-::\-Shm}!read@{read}}
\index{read@{read}!duye::Shm@{duye\-::\-Shm}}
\subsubsection[{read}]{\setlength{\rightskip}{0pt plus 5cm}bool duye\-::\-Shm\-::read (
\begin{DoxyParamCaption}
\item[{const uint32}]{offset, }
\item[{int8 $\ast$}]{buffer, }
\item[{const uint32}]{size}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_shm_a7c14682004721b9f76964fd88204e3a4}


read data from shm 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em offset} & \-: offset of shm \\
\hline
\mbox{\tt in}  & {\em buffer} & \-: output buffer \\
\hline
\mbox{\tt in}  & {\em size} & \-: read size \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\end{DoxyNote}
\hypertarget{classduye_1_1_shm_a4b3279f66ae42910d650eef3cb25f4a9}{\index{duye\-::\-Shm@{duye\-::\-Shm}!size@{size}}
\index{size@{size}!duye::Shm@{duye\-::\-Shm}}
\subsubsection[{size}]{\setlength{\rightskip}{0pt plus 5cm}uint64 duye\-::\-Shm\-::size (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classduye_1_1_shm_a4b3279f66ae42910d650eef3cb25f4a9}


get shm size 

\begin{DoxyReturn}{Returns}
shm size 
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\end{DoxyNote}
\hypertarget{classduye_1_1_shm_a15f7a79aa99263339f9d94846fd36ddf}{\index{duye\-::\-Shm@{duye\-::\-Shm}!sync@{sync}}
\index{sync@{sync}!duye::Shm@{duye\-::\-Shm}}
\subsubsection[{sync}]{\setlength{\rightskip}{0pt plus 5cm}bool duye\-::\-Shm\-::sync (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_shm_a15f7a79aa99263339f9d94846fd36ddf}


sync the shm 

\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\end{DoxyNote}
\hypertarget{classduye_1_1_shm_a7094da8b2ea2a6116375945f2c43c256}{\index{duye\-::\-Shm@{duye\-::\-Shm}!write@{write}}
\index{write@{write}!duye::Shm@{duye\-::\-Shm}}
\subsubsection[{write}]{\setlength{\rightskip}{0pt plus 5cm}bool duye\-::\-Shm\-::write (
\begin{DoxyParamCaption}
\item[{const uint32}]{offset, }
\item[{const int8 $\ast$}]{data, }
\item[{const uint32}]{length}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_shm_a7094da8b2ea2a6116375945f2c43c256}


write data to shm 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em offset} & \-: offset of shm \\
\hline
\mbox{\tt in}  & {\em data} & \-: input data \\
\hline
\mbox{\tt in}  & {\em size} & \-: write size \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\end{DoxyNote}


The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Z\-:/duye/src/duyebase/system/\hyperlink{duye__shm_8h}{duye\-\_\-shm.\-h}\end{DoxyCompactItemize}
